<?php
@session_start ();
if(!isset($_SESSION['username'])) {
	header("location:log_in.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="../u_css/base_Info.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>基本信息设置</title>
</head>
<body>
<?php
require '../mysql_connection/for_u_lijinsheng.php';
include '../include_htmls/header.php';
?>
<div id="body">
<?php
if (isset ( $_GET ['username'] )) {
	$last_username = $_GET ['username'];
	$last_gendar = $_GET ['gendar'];
	echo $last_gendar;
	chang_gendar ( $last_username, $last_gendar );
	unset ( $_GET ['username'] );
	unset ( $_GET ['gendar'] );
}
if (isset ( $_SESSION ['username'] )) {
	$username = $_SESSION ['username'];
	$base_Info = get_Base_Info ( $username );
	?>
<div id="left-navigation">
<ul>
	<li class="current">基本信息</li>
	<li><a href="chang_password.php" class="unclick">修改密码</a></li>
	<li><a class="unclick" href="credit_Info.php">账户信息</a></li>
</ul>
</div>

<div id="content">
<h1>个人基本信息</h1>
<form action="base_Info.php" method="get">
<div><input type="hidden" name="username" value="<?=$username?>">
<p id="username">用户名：<?=$base_Info [0]?></p>
<?php
	//0表示是男性
	if (ord($base_Info [1]) == 0) {
		?>
<label><input id="man" type="radio" name="gendar" value="0"
	checked="checked" />男</label> <label><input id="woman" type="radio"
	name="gendar" value="1" />女</label>	
<?php
	} else {
		?>
		<label><input id="man" type="radio" name="gendar" value="0" />男</label>
<label><input type="radio" id="woman" name="gendar" value="1"
	checked="checked" />女</label>
	<?php
	}
	?>
	<p id="stage">当前等级：<?=$base_Info [2]?></p>
<p id="socre">当前积分： <?=$base_Info [3]?></p>
<input id="submit-button" type="submit" value="保存"/></div>
</form>
</div>
<?php
} else {
	?>
<p id="not-log">还没有登录哟！</p>
<?php
}
?>
</div>
<?php

include '../include_htmls/footer.html';
?>
</body>
</html>